package com.example.wxback.service;

import com.alibaba.fastjson.JSONObject;
import com.example.wxback.dao.ConfigDao;
import com.example.wxback.model.ConfigInfo;
import com.example.wxback.util.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConfigService {

    @Autowired
    private ConfigDao configDao;

    /**
     * 用户列表
     */
    public JSONObject list(JSONObject jsonObject) {
        CommonUtil.fillPageParam(jsonObject);
        List<JSONObject> list = configDao.list(jsonObject);
        return CommonUtil.successJson(list);
    }

    public ConfigInfo getById(Integer id) {
        return configDao.getById(id);
    }

    public int insert(ConfigInfo configInfo) {
        return configDao.insert(configInfo);
    }

    public int update(ConfigInfo configInfo) {
        return configDao.update(configInfo);
    }
}
